var prmoseHttp = require('../../utils/prmoseHttp.js');
var app = getApp();
Page({
  data: {
    statusBarHeight: '',
    titleBarHeight: '',
    navHeight: '',
    signOpened: false,
    imgSrc:'https://rhi0.xiyun.net/zhuandian/',
    inVita:{},
    active:true,
  },
  onLoad() {
     my.getSystemInfo({
      success: (res) => {
        this.setData({
          'statusBarHeight': res.statusBarHeight,//状态栏高度 
          'titleBarHeight': res.titleBarHeight,//标题栏高度
          'navHeight': res.statusBarHeight + res.titleBarHeight //导航栏高度
         
        })
      }
    });
    this.getReward();
  },
  getReward(){
    let that = this;
    prmoseHttp.publicRequest(prmoseHttp.apiAddress.invitaReward,{},1,'get').then(res=>{
      // console.log(res)
      that.setData({
        inVita:res.data
      })
      // my.stopPullDownRefresh();
    })
  },
  selTab(e){
    let num = e.currentTarget.dataset.num;
    if(num == '1'){
      this.setData({
        active : true
      })
    }else{
      this.setData({
        active : false
      })
    }
  },
  // onPullDownRefresh() {
  //   my.startPullDownRefresh();
  //   this.getReward();
  // },
});
